package com.wmyg.antifake.repository;

import com.wmyg.antifake.entity.BkUser;
import com.wmyg.antifake.entity.UserAddress;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 王卓逸
 * @program TODO
 * @description TODO
 * @create 2019-05-26
 */
@Repository
public interface UserAddressRepository extends JpaRepository<UserAddress, Integer> {

    List<UserAddress> findByUserAndStateGreaterThanOrderByCreateTimeAsc(BkUser user, Integer state);

    List<UserAddress> findByUserAndStateOrderByCreateTimeAsc(BkUser user, Integer state);

    UserAddress findByAddressId(Integer addressId);

}
